import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)
const routes = [
  {
    path: '',
    name: 'Home',
    component: () => import('../views/Home.vue')
  },
  {
    path: '/t1',
    name: 'Home',
    component: () => import('../views/T1.vue')
  },
  {
    path: '/login',
    name: 'Login',
    component: () => import('../components/system/Login.vue')
  },
  ...require('./children/vehicle').default, // 车辆模块
  ...require('./children/user').default, // 用户模块
  ...require('./children/practice').default, // 最佳实践模块

  { path: '*', name: '404', component: () => import('../components/system/404.vue') }
]

const router = new VueRouter({
  mode: 'history',
  base: `/${require('../../package.json').name}`,
  routes
})

export default router
